package scuts.core.instances;

import scuts.core.classes.Ord;

class OrdEnumDynamic extends Ord<Enum<Dynamic>> {
  
  // boilerplate, should be avoided
  public static var get(getInstance, null):OrdEnumDynamic;
  
  static function getInstance ()
  {
    if (get == null) get = new OrdEnumDynamic(EqEnumByIndex.get);
    return get;
  }
  //
  
  override public function lessOrEq (a:Enum<Dynamic>, b:Enum<Dynamic>):Bool {
    return Type.enumIndex(a) <= Type.enumIndex(b);
  }
}